<?php
include("ggheader.php");
include_once('/var/www/html/wx/api/pc_shops/init_dt.php');
define('DETAIL_LINK','/new/d/shops/gdetail.html');// 详情链接地址
if(APPLY_DID==7517){
    include_once('gtindex_gly.html');
    exit;
}
$soap    = SoapInit::GetSoapInside();

$types = array(
    'A'=>'景区门票',
    'B'=>'旅游路线',
    'C'=>'酒店预定',
    'F'=>'套票产品',
    'H'=>'演出产品'
);
$urls = array(
    'A'=>'gtTicket.html',
    'B'=>'groute.html',
    'C'=>'ghlist.html',
    'F'=>'gpackage.html',
    'H'=>'gpackage.html?p_type=H'
);
$unShow = array('G');
if($_SESSION['domain_mid']==7517){
    $unShow = array('A','G','B','C');
}
if($_GET['debug']){
	print_r($saveArr);
}
// print_r($saveArr['products']['A']);
$hot = $saveArr['products']['A'];
if(count($hot)){
    shuffle($hot);
    ksort($saveArr['products']);
}
?>
<div id="ggBanner" class="ggBanner">
    <div class="bstage">
        <ul class="slideUl">
            <li class="sitem"><a href="#"><img src="<?=$shop['M_banner']?>" alt=""/></a></li>
        </ul>
    </div>
    <div class="bnavCon">
        <div class="ggw1100 bnavInn">
<!--            <ul class="bnavW navUl" style="display: none;">-->
<!--                <li class="first">-->
<!--                    <h3 class="tit ggellipsis">工程化的Web前端开发规范</h3>-->
<!--                    <p class="desc ggellipsis">关于前端开发编码规范的讨论愈来愈多。国外和国内的顶尖开发者几乎同时对编码规范产生了很大兴趣，前Yahoo!首页首席前端工程师N.C. Zakas在他那本《高可维护的JavaScript》</p>-->
<!--                </li>-->
<!--                <li class="active">-->
<!--                    <h3 class="tit ggellipsis">Web移动终端开发</h3>-->
<!--                    <p class="desc ggellipsis">除了在本地编译应用之外，还可以使用PhoneGap提供的云 端Build工具进行应用编译。也就是说，只需要将用HTML5写好的应用上传到PhoneGap的</p>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <h3 class="tit ggellipsis">Bootstrap</h3>-->
<!--                    <p class="desc ggellipsis">Twitter推出的一个开源的用于前端开发的工具包。它由Mark Otto和Jacob Thornton合作开发，是一个CSS/HTML框架。</p>-->
<!--                </li>-->
<!--                <li>-->
<!--                    <h3 class="tit ggellipsis">AngularJS应用的解析</h3>-->
<!--                    <p class="desc ggellipsis">模板是您用HTML和CSS编写的文件，展现应用的视图。 您可给HTML添加新的元素、属性标记，作为AngularJS编译器的指令。</p>-->
<!--                </li>-->
<!--            </ul>-->
        </div>
    </div>
</div>
<div class="ggMainCon ggw1100 clearfix">
    <div class="mainCol l">
    <?php if(count($saveArr['products'])):?>
        <?php foreach($saveArr['products'] as $p_type =>$products):?>
        <?php if(in_array($p_type,$unShow)) continue; ?>
        <?$count = 3; ?>
            <div class="gglistGroup col-<?=$count?> clearfix" style="margin-bottom:30px;">
                <div class="gghd"><h3 class="col l"><?=$types[$p_type]?></h3><a class="col r" href="<?=$urls[$p_type]?>">更多》</a></div>
                <ul class="listUl clearfix">
                    <?php $i = 0;?>
                    <?php foreach($products as $key=>$data):?>
                    <?if((++$i)>3 || $key=='total') break;?>
                    <?if($data['px']<0) continue;?>
                        <?php
                            $priceArr = $tPriceArr = array();
                            foreach($saveArr['tickets'][$key] as $ticket) {
                                $price = mobile_sale_price($soap, '', $ticket['pid'], $Y_m_d, true, $ticket['sapply_did']);
                                if ($price==-1) continue;
                                $priceArr[$key][]   = $price;
                                $tPriceArr[$key][]  = $ticket['tprice'];
                            }
                        ?>
                    <li class="ggListItem">
                        <div class="photo"><a href="<?=DETAIL_LINK.'?lid='.$key?>" target="_blank"><img src="<?=$data['imgpath']?>" alt="<?=$data['title']?>"/></a></div>
                        <div class="bCon">
                            <a class="awrap" href="<?=DETAIL_LINK.'?lid='.$key?>" target="_blank">
                                <span class="tit ggellipsis"><?=$data['title']?></span>
                                <!--<span class="desc ggellipsis">描述</span>-->
                                <span class="fw clearfix">
                                    <span class="col price l">
                                        <span class="p p1">原价：<i class="yen">&yen;</i><span class="num"><?= min($tPriceArr[$key]) ?></span></span>
                                        <span class="p p2">预订价：<i class="yen">&yen;</i><span class="num"><?= min($priceArr[$key]) / 100 ?></span></span>
                                    </span>
                                    <span class="col online r">在线预订</span>
                                </span>
                            </a>
                        </div>
                    </li>
                    <?endforeach;?>
                </ul>
            </div>
            <?endforeach;?>
        <?php endif;?>
    </div>
    <div class="ggNoticeBar mainCol r">
        <div id="sucOrderList" class="nbox sucOrder sucOrderBar">
            <p class="tit"><i class="gsprite gicon sucOrder"></i><span class="t">预订成功</span></p>
            <div id="newsSlideStage" class="conWrap">
                 <ul id="newsSlideListUl" class="listUl">
                    <?for($i=0;$i<3;$i++):?>
                         <li><span class="t">2014/12/20 20:30:26</span><span class="user">张*全</span><span class="suc">成功预订</span><a href="#" class="pn">鼓浪屿核心景点套票成人票</a></span></li>
                     <?endfor;?>
                </ul>
            </div>
        </div>
       <!--  <div class="nbox news">
            <p class="tit"><i class="gsprite gicon news"></i><span class="t">最新公告</span></p>
            <ul class="con">
                <li><a href="#" class="ggellipsis">最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送</a></li>
                <li><a href="#" class="ggellipsis">最近公告通知消息推送最近公告通知消息推送最近公告通知消息推送最近公告通知消息推送</a></li>

            </ul>
        </div> -->
		 <div class="gglistGroup col-1" style="margin-top:10px">
			<div class="gghd"><span class="col l">为您推荐</span></div>
			<ul class="listUl">
                <?$hi=0;?>
                <?if(count($hot)){foreach($hot as $key=>$hdata):?>
                <?if(!is_array($hdata)) continue;?>
                <?if((++$hi)>2) break;?>
				<li class="ggListItem">
					<div class="photo"><a href="<?=DETAIL_LINK.'?lid='.$hdata['id']?>" target="_blank"><img src="<?=$hdata['imgpath']?>" alt="<?=$hdata['title']?>"/></a></div>
					<div class="bCon">
						<a class="awrap" href="<?=DETAIL_LINK.'?lid='.$hdata['id']?>" target="_blank">
							<span class="tit ggellipsis"><?=$hdata['title']?></span>
							<!--<span class="desc ggellipsis"></span>-->
							<span class="fw clearfix">
								<span class="col price l">
									<span class="p p1">原价：<i class="yen">&yen;</i><span class="num"><?=$hdata['tprice']?></span></span>
									<span class="p p2">预订价：<i class="yen">&yen;</i><span class="num"><?=$hdata['uprice']?></span></span>
								</span>
								<span class="col online r">在线预订</span>
							</span>
						</a>
					</div>
				</li>
                <?endforeach;}?>
			</ul>
		</div>
    </div>
    <div class="mbanner"><a href="#"><img src="http://www.12301.cc/shops/asset/mbanner140.png" alt=""/></a></div>
    <div class="gglistGroup col-4 clearfix">
        <div class="gghd"><h3 class="col l">热门推荐</h3><a class="col r" href="#">更多》</a></div>
        <ul class="listUl clearfix">
            <?$hi=0;?>
            <?if(count($hot)){foreach($hot as $key=>$hdata):?>
            <?if(!is_array($hdata)) continue;?>
            <?if((++$hi)>8) break;?>
            <li class="ggListItem">
                <div class="photo"><a href="<?=DETAIL_LINK.'?lid='.$hdata['id']?>" target="_blank"><img src="<?=$hdata['imgpath']?>" alt="<?=$hdata['title']?>"/></a></div>
                <div class="bCon">
                    <a class="awrap" href="<?=DETAIL_LINK.'?lid='.$hdata['id']?>" target="_blank">
                        <span class="tit ggellipsis"><?=$hdata['title']?></span>
                        <!--<span class="desc ggellipsis"></span>-->
                        <span class="fw clearfix">
                            <span class="col price l">
                                <span class="p p1">原价：<i class="yen">&yen;</i><span class="num"><?=$hdata['tprice']?></span></span>
                                <span class="p p2">预订价：<i class="yen">&yen;</i><span class="num"><?=$hdata['uprice']?></span></span>
                            </span>
                            <span class="col online r">在线预订</span>
                        </span>
                    </a>
                </div>
            </li>
            <?endforeach;}?>
           
        </ul>
    </div>
</div>
<script type="text/javascript">
    G.SucOrderNews.init();
</script>
<?php include("ggfoot.php");?>
</body>